<?php
class User_manage_model extends Model {

    function User_manage_model()
    {
        parent::Model();
    }
    
    function judge_pass($pass)
    {
    	if($pass == "vertrigo") 
    		return 0;
    	else
    		return 1; 
    }
    
    function save_modify($_POST)
    {   
    	$data = array(	
    				  	'name' => $_POST['name'],
               		  	'pass' => $_POST['pass']
            		 );
 		$this->db->where('id', $_POST['id']);
		$this->db->update('user_manage', $data); 
		echo "modify succeed";
    }
    
    function delete_user($id)
    {
    	$this->db->where('id', $id);
		$this->db->delete('user_manage'); 
		echo "delete succeed";
    }
    
    function save_add($_POST)
    {   
    	$data = array(
						'name' => $_POST['name'],
               		  	'pass' => $_POST['pass']
            		 );

		$this->db->insert('user_manage', $data);
		echo "add succeed";
    }
}
?>